package com.CMS.client;

import com.CMS.client.ui.view.MultimediaView;
import com.CMS.client.ui.view.PrivilegeView;
import com.CMS.client.ui.view.RolView;
import com.CMS.client.ui.view.SettingLanguageView;
import com.CMS.client.ui.view.UserView;
import com.google.gwt.core.client.GWT;


public class InstancePage
{
 private Class<?> token;
 
 
 public InstancePage(String token)
 {
	 
  if(token.equals(NameTokens.PRIVILEGE_VIEW) )
     this.token=PrivilegeView.class;
  else  
  if(token.equals(NameTokens.ROLVIEW))
     this.token=RolView.class;
  else
  if(token.equals(NameTokens.USER_VIEW))
	 this.token=UserView.class; 
  else if(token.equals(NameTokens.FILE_UPLOAD_VIEW))
	  this.token = MultimediaView.class;
  else if(token.equals(NameTokens.LANGUAGE_VIEW))
	  this.token = SettingLanguageView.class;
		  
 }
 
 public Object getInstancePage() 
 {
  
  return GWT.create(this.token);

 }
 
 public String getName()
 {
 	return this.token.getName(); 
 }
}
